<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>

    <th:block th:include="MainInterface/include :: common-css" />

</head>

<body class="fixed-left">

<div id="wrapper">
    <th:block th:include="MainInterface/include :: header-menu(2)" />
    <div class="dialog">
    <form id="bookList">

        <div class="dialog-box">
            <h1>修改类别</h1>
            <p>
                ID :
                <input  name="id" th:value="${categroyList.id}" readonly unselectable="on">
            </p>
            <p>
                类型 :
                <input name="cateName" th:value="${categroyList.cateName}" >
<!--                th:text="${categroyList.cateName}"-->
            </p>

        <div>
        <input style="width: 75px ; height : 50px " type="button" id="book_save" onclick="Categroyadd()" naem="修改" value="修改">
<!--        <button >提交</button>-->
        <button style="width: 75px ; height : 50px "><a  href="/bookCategroy">返回</a></button>
        </div>
        </div>
    </form>
    </div>
</div>
<th:block th:include="MainInterface/include :: foter" />
<th:block th:include="MainInterface/include :: common-js" />
</body>

<script>
    function Categroyadd(){
        $.ajax({
            type:"post",
            url:"/bookCategroy/saveOrUpdata",
            data:$("#bookList").serialize(),
            async:false,
            dataType:'json',
            success:function (result) {
                console.log(result.code)
                if (result.code == 0) {
                    window.alert("修改成功");
                    window.location.href="/bookCategroy"
                    // window.location.reload();
                } else {
                    window.alert(result.msg || "修改失败");
                }
                console.log(result)
            }
        });
    }


</script>
<style>
    a:link{
        color: black;
        text-decoration: none;
    }
    a:visited {
        text-decoration: none;
        color: black;
    }
    a:hover {
        text-decoration: none;
        color: black;
    }
    a:active {
        text-decoration: none;
        color: black;
    }

</style>
</html>